﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MBSPL.UserControls.CinemaUserControl
{
    public partial class RemoveCinemaUserControl : System.Web.UI.UserControl
    {
        #region transfer
        MBSBLC.BLC cinemable = new MBSBLC.BLC();

        public delegate void RemoveCinemaHandler();

        public event RemoveCinemaHandler RemoveCinemaSuccesull;
        public event RemoveCinemaHandler RemoveCinemaFailed;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                CinemaList1.LoadDropDownBox();
            
            }

            CinemaList1.CimeListChanged += new CinemaList.CinemaListHandler(CinemaList1_CimeListChanged);
        }

        void CinemaList1_CimeListChanged(int SelectedValue)
        {
           //do nothing 
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (cinemable.DeleteCinema(CinemaList1.GetSelectedValue()))
            {
                RemoveCinemaSuccesull();
            }

            else
            {
                 RemoveCinemaFailed();
            }
        }
    }
        #endregion
}